import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/layout/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: Layout,
      redirect: '/home',
      children: [
        {
          path: '/home',
          name: 'home',
          component: () => import('@/views/home/index.vue')
        },
        {
          path: '/appointment',
          name: 'appointment',
          component: () => import('@/views/appointment/index.vue')
        },
        {
          path: '/appointment-list',
          name: 'appointment-list',
          component: () => import('@/views/appointmentList/index.vue')
        },
        {
          path: '/customer-query',
          name: 'customer-query',
          component: () => import('@/views/customerQuery/index.vue')
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index.vue')
    }
  ]
})

export default router
